package com.black.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.black.common.core.domain.entity.SysRole;
import com.black.system.domain.req.system.query.SysRoleQueryReq;
import com.black.system.domain.resp.system.SysRoleResp;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author L
 * @description 针对表【sys_role(角色信息表)】的数据库操作Mapper
 * @createDate 2024-08-19 10:07:23
 * @Entity com.black.common.core.domain.entity.SysRole
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {
    /**
     * 根据用户ID查询角色
     *
     * @param userId
     * @return
     */
    List<SysRole> findRolesByUserId(Long userId);

    List<SysRoleResp> paginationQuery(@Param("req") SysRoleQueryReq req);

    /**
     * 导出角色列表
     *
     * @param ids
     * @return
     */
    List<SysRoleResp> export(@Param("ids") Long[] ids);
}




